using Blog.Service;
using Blog.Service.View;
using Blog.Service.View.Output;
using Microsoft.AspNetCore.Mvc;

namespace Blog.API.Controllers;



/// <summary>
/// 视图管理
///</summary>
[ApiController]
[Route("api/admin/[controller]/[action]")]
public class ViewController  : CrudController<ViewModel>
{
    IViewService _viewService;
    public ViewController(IViewService viewService) : base(viewService)
    {
        _viewService = viewService;
    }

    /// <summary>
    /// 查询全部视图
    /// </summary>
    /// <param name="key"></param>
    /// <returns></returns>
    [HttpGet]
    public async Task<List<ViewListOutput>> GetList(string? key)
    {
        return await _viewService.List(key);
    }
}